package com.fansl.allround.oss.api.config;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/2 19:08
 */
@Data
@Configuration
@RefreshScope
@ConditionalOnExpression("!'${oss.aliyun}'.isEmpty()")
@ConfigurationProperties(prefix = "oss.aliyun")
public class AliYunOssPropertiesConfig {
    private String endpoint;
    private String accessKeyId;
    private String accessKeySecret;
    private String bucketName;
    /**
     * The callback url，
     * for example: http://oss-demo.aliyuncs.com:23450或http://0.0.0.0:9090
     * The service of that url must support the post method.
     */
    private String callbackUrl;
    private long expireInSeconds = 3600;
}
